#ifndef  __LASER_CH4_H
#define  __LASER_CH4_H

//----------------------------------Include-------------------------------------
#include  <stdint.h>
//------------------------------------------------------------------------------

//-----------------------------------Macro--------------------------------------
#define  SNSR_CH4_LS_69             (0x00)
#define  SNSR_CH4_LS_AK             (0x01)
#define  SNSR_CH4_LS_WG             (0x02)
#define  SNSR_CH4_LS_XHYS           (0x03)
//------------------------------------------------------------------------------
#define  CH4_NO_ERR                    (0)
#define  CH4_ERR_COMM               (0x55)
//------------------------------------------------------------------------------

//------------------------------------Type--------------------------------------
typedef struct{
  uint16_t   ch4;
  uint16_t   t;
  uint16_t   err;
  uint16_t   done;
}t_ch4;
//------------------------------------------------------------------------------

//---------------------------------Share Var------------------------------------
#ifdef  LASER_CH4_GLOBALS
#else
extern t_ch4                   gt_ch4_rt;
extern t_ch4                   gt_ch4_res;
#endif
//------------------------------------------------------------------------------

//--------------------------------Extern Func-----------------------------------
//------------------------------------------------------------------------------

//----------------------------------Declare-------------------------------------
void     it_laser_ch4_rcv_one_byte(unsigned char c);
void     it_laser_ch4_rcv_done(void);
//------------------------------------------------------------------------------
void     laser_ch4_reset(void);
void     laser_ch4_open(void);
void     laser_ch4_close(void);
void     laser_ch4_cyc(void);
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
void     laser_ch4_calib_shandong(uint32_t value);
void     laser_ch4_set_zero_shandong(void);
void     laser_ch4_reset_shandong(void);
void     laser_ch4_query_shandong(void);
uint32_t laser_ch4_parse_shandong(char* p, unsigned int sz, float* ch4, float* t, uint8_t* code);
//------------------------------------------------------------------------------
void     laser_ch4_calib_dalian(uint32_t value);
void     laser_ch4_set_zero_dalian(void);
void     laser_ch4_reset_dalian(void);
uint32_t laser_ch4_parse_dalian(char* p, unsigned int sz, float* ch4, float* t, uint8_t* code);
//------------------------------------------------------------------------------
uint32_t laser_ch4_parse_xhys(char* p, unsigned int sz, float* ch4, float* t, uint8_t* code);
//------------------------------------------------------------------------------

#endif
//------------------------------------EOF---------------------------------------








